# -*- coding: utf-8 -*-

import warnings

import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from gensim.test.utils import common_texts
from gensim.models import Word2Vec

from ..base import CommonFunction


class TextProcesser(CommonFunction):
    def word2vec(self):
        model = Word2Vec(common_texts, size=100, window=5, min_count=1, workers=4)
        model.train(self._data, epochs=10)
        # Todo

    def count_vectorizer(self):
        c_vec = CountVectorizer()
        self._data = pd.DataFrame(c_vec.fit_transform(self._data))
        return c_vec

    def tfidf_vectorizer(self):
        t_vec = TfidfVectorizer()
        self._data = pd.DataFrame(t_vec.fit_transform(self._data))
        return t_vec
